// Functions associated with the AudioAsset class
//-----------------

//-----------------
// Includes libraries and other files
#include "AudioAsset.h"
//-----------------

//-----------------
//// CONSTRUCTOR - AudioAsset
AudioAsset::AudioAsset()
	: file_name_( ""), asset_name_( "")
{}

//// CONSTRUCTOR - AudioAsset
AudioAsset::AudioAsset( const std::string fn)
	: file_name_( fn), asset_name_( fn)
{}

//// CONSTRUCTOR - AudioAsset
AudioAsset::AudioAsset( const AudioAsset& a)
	: file_name_( a.get_file_name()), asset_name_( a.get_asset_name())
{}

//// DESTRUCTOR - ~AudioAsset
AudioAsset::~AudioAsset() {}
//-----------------

//-----------------
//// FUNCTION - get_file_name
// return the asset's file name (i.e. where the asset is loaded from)
std::string AudioAsset::get_file_name() const {
	// Pre-conditions :- none
	assert( true);

	return file_name_;
}

//// FUNCTION - get_asset_name
// return the asset's name (i.e. the one provided by the user)
std::string AudioAsset::get_asset_name() const {
	// Pre-conditions :- none
	assert( true);

	return asset_name_;
}

//// FUNCTION - set_file_name
// set the file's name (the location of the audio file)
void AudioAsset::set_file_name( const std::string& f) {
	// Pre-conditions :- none
	assert( true);

	file_name_ = f;
}

//// FUNCTION - set_asset_name
// set the asset's name (that will be displayed on the sidebar)
void AudioAsset::set_asset_name( const std::string& a) {
	// Pre-conditions :- none
	assert( true);

	asset_name_ = a;
}

//// FUNCTION - fill_in_the_blanks
// to be used on new assets before they can be given proper details by the user
void AudioAsset::fill_in_the_blanks() {
	// Pre-conditions :- the asset name must be absent
	assert( asset_name_ == "");

	asset_name_ = file_name_;
}

//// OVERLOADED OPERATOR - ==
bool AudioAsset::operator ==( const AudioAsset& a) const {
	// Pre-conditions :- none
	assert( true);

	if( get_file_name() == a.get_file_name())
		return true;
	else
		return false;
}

//// OVERLOADED OPERATOR - <
bool AudioAsset::operator <( const AudioAsset& a) const {
	// Pre-conditions :- none
	assert( true);

	// order the assets alphabetically so the nameless assets are last
	if( get_file_name() == a.get_file_name() && ( a.get_asset_name() < get_asset_name()))
		return true;
	else
		return false;
}

//// OVERLOADED OPERATOR - >
bool AudioAsset::operator >( const AudioAsset& a) const {
	// Pre-conditions :- none
	assert( true);

	// > is the opposite of <
	return !( (*this) < a);
}